Page({
  data: {
    repairList: [],
    isEmpty: true
  },
  onLoad () {
    this.getRepairList()
  },
  onShow () {
    this.getRepairList()
  },
  //获取报修信息
  async getRepairList () {
    const data = await wx.http.get('/repair', { current: 1, pageSize: 10 })
    console.log(data)
    this.setData({ repairList: data.data.rows, isEmpty: data.data.rows.length === 0 })
  },

  goDetail (ev) {
    // console.log(ev.mark.id)
    const id = ev.mark.id
    wx.navigateTo({
      url: '/repair_pkg/pages/detail/index?id=' + id
    })
  },
  addRepair () {
    wx.navigateTo({
      url: '/repair_pkg/pages/form/index'
    })
  }
})
